import { BaseEntity } from "src/common/entity/BaseEntity";
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";

@Entity("classification", { comment: "分类表" })
export class Classification extends BaseEntity {
  // 分类名称
  @Column({ comment: "分类名称" })
  title: string;

  // 分类别名
  @Column({ comment: "分类别名" })
  alias: string;

  // 分类描述
  @Column({ comment: "分类描述" })
  description: string;

  // 父分类ID
  @ManyToOne((type) => Classification, (classification) => classification.id)
  @JoinColumn({ name: "parent_id" })
  parent: string;
}
